<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    String date = format.format(new Date());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPageAsEnrol.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CartimeListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CoachListPage.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    tr td:nth-child(1) {
        color: black;
        font-size: inherit;
    }

    #tablelist {
        width: 100%;
        table-layout: fixed;
        margin-top: 30px
    }

    #tablelist td {
        width: 100px;
        height: 40px;
    }

    .div_form table input {
        width: 150px;
        height: 26px
    }

    .div_form table input[type=checkbox] {
        margin-top: 8px;
        width: 30px;
        height: 15px;
    }

    .check2 {
        margin-top: -8px;
    }
</style>
<body style="background: #f5f5f5">

<div class="main">
    <div id="modal-overlay">

    </div>

    <div class="weizhi">
        预约管理>>练车预约>>查看
    </div>
    <div class="div_body" style="min-height: 800px;">


        <c:if test="${flag eq 1 }">
            <div class="div_form" style="margin: 0 20px;width: auto;">
                <form id="form" action="<%=path%>/DrivingSys/add_Sharecarsubentry" method="post" class="form">
                    <table id="tablelist">
                        <tr>
                            <td rowspan="5" style="padding-right: 20px">
                                <img class="photo" width="180px" height="200px" src="">
                            </td>
                            <td>驾校:</td>
                            <td>
                                <input type="text" value="${department}" disabled="disabled" style="color: gray;"/>
                                <input type="hidden" name="cfficompanyid" value="${department}">
                                <input type="hidden" class="state" value="1">
                            </td>
                            <td>练车时间:</td>
                            <td>
                                <input name="cfdycs" value="" style="color: gray;" onclick="clicklcsj($(this))"/>
                                <input type="hidden" name="cflcsjid" value="" style="color: gray;"/>
                            </td>
                            <td>科目:</td>
                            <td colspan="3">
                                <select style="width: 150px;height: 32px" class="cfbilltype" name="cfsubject">
                                    <option selected="selected" value="2" style="font-size: 16px">科目二</option>
                                    <option value="3" style="font-size: 16px">科目三</option>
                                </select>
                            </td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>单据编码:</td>
                            <td><input type="text" name="fnumber" style="color: gray;"
                                       value="${fnumber}"/></td>
                            <td>学员编码:</td>
                            <td><input type="text" class="cfstudentno" name="cfstudentno" value=""
                                       onclick='clickName($(this))'/>
                            </td>
                            <td>学员名称:</td>
                            <td>
                                <input type="text" class="cfstudentname" disabled="disabled" style="color: gray;"/>
                                <input type="hidden" class="cfstudentid" name="cfstudentid" value="">
                                <input type="hidden" name="cfstudentname" class="cfstudentname">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><input type="checkbox" id="cfvip" style="color: gray;float: left;"/>
                                <input type="hidden" name="cfvip" class="cfvip">
                                <div style="height: 30px;display:table-row-group;float: left;margin: 5px 10px">VIP</div>
                            </td>
                            <td>班级:</td>
                            <td class="clazz">
                                <input type="text" class="cfclazzName" value=""/>
                                <input type="hidden" name="cfclazzid" class="cfclazzid" value="">
                            </td>
                            <td>预约结果:</td>
                            <td>
                                <select style="width: 150px;height: 32px" name="cfsubresult">
                                    <option value="1" selected="selected" style="font-size: 16px">预约成功</option>
                                    <option value="2" style="font-size: 16px">预约失败</option>
                                </select>
                            </td>
                        </tr>
                        <tr>


                            <td>电话:</td>
                            <td>
                                <input type="text" class="cfphone" disabled="cfphone" style="color: gray;"/>
                                <input type="hidden" name="cfphone" class="cfphone">
                            </td>
                            <td>申请准驾车型:</td>
                            <td>
                                <select style="width: 150px;height: 32px" disabled="disabled">
                                    <option value="A1" style="font-size: 16px" class="cfsqzjcxdh">A1</option>
                                </select>
                                <input type="hidden" name="cfsqzjcxdh" class="cfsqzjcxdh">
                            </td>
                            <td>下一次预约日期:</td>
                            <td colspan="3">
                                <input type="text" id="cfnexttime" name="cfnexttime" value="${time}"
                                       onclick="WdatePicker({el:'cfnexttime',dateFmt:'yyyy-MM-dd'})">
                            </td>
                            <td><img onclick="WdatePicker({el:'cfnexttime',dateFmt:'yyyy-MM-dd'})"
                                     src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px"></td>
                        </tr>
                        <tr>
                            <td>教练名称:</td>
                            <td>
                                <input type="text" name="cfcoachname" class="cfcoachname"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfcoachid" class="cfcoachid">
                            </td>
                            <td>预约教练编码:</td>
                            <td><input type="text" class="yyjlfnumber" onclick='clickJlname($(this))'
                                       style="color: gray;"/>
                                <input type="hidden" name="yyjlfnumber" class="yyjlfnumber">
                            </td>
                            <td>原教练:</td>
                            <td>
                                <input type="text" class="yjlname" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfoldcoachid" class="cfoldcoachid">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>科目二考试时间:</td>
                            <td><input type="text" class="cfkmekssj" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfkmekssj" class="cfkmekssj">
                            </td>
                            <td>科目三不及格时间:</td>
                            <td>
                                <input type="text" class="cfkmsbjksj" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfkmsbjksj" class="cfkmsbjksj">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>应收金额:</td>
                            <td><input type="text" class="cfamount" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfamount" class="cfamount"></td>
                            <td>已收:</td>
                            <td><input type="text" class="cfreceived" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfreceived" class="cfreceived">
                            </td>
                            <td>优惠:</td>
                            <td>
                                <input type="text" class="cffavorable" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cffavorable" class="cffavorable">
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="5"></td>
                            <td>欠费:</td>
                            <td>
                                <input type="text" class="cfarrearage" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfarrearage" class="cfarrearage">
                            </td>
                            <td>车型:</td>

                            <td>
                                <input type="hidden" name="cfcarbyte" class="cfcarbyte">
                                <select disabled="disabled" style="width: 150px;height: 32px">
                                    <option class="cfcarbyte" style="font-size: 16px">小车</option>
                                </select>
                            <td>手机:</td>
                            <td>
                                <input type="text" name="cfmobile" class="cfmobile" disabled="disabled"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfmobile" class="cfmobile">
                            </td>


                            </td>
                        </tr>
                        <tr>
                            <td>身份证号码:</td>
                            <td>
                                <input type="text" class="cfidcardno" name="cfidcardno" value="" style="color: gray;"/>
                            </td>
                            <td>交补考费次数:</td>
                            <td>
                                <input type="text" name="cfjbkcs" class="cfjbkcs" value="" style="color: gray;"/>
                            </td>
                            <td>交补考费总额:</td>
                            <td>
                                <input type="text" name="cfjbkfje" class="cfjbkfje" value="" style="color: gray;"/>
                            </td>
                        </tr>
                        <tr>
                            <td>考试次数:</td>
                            <td>
                                <input type="text" name="cfkscs" class="cfkscs" value="" style="color: gray;"/>
                            </td>
                        </tr>
                        <tr>
                            <td>备注:</td>
                            <td colspan="2">
                                <textarea name="cfremark" rows="5" cols="78"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div style="width: 200px; margin-left: 400px">
                                    <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px"
                                          class="addTable">添加</span>
                                    <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                    <span class="deleteTable" style="color: #a9bbe0;font-size: 14px"
                                          class="deleteTable">删除</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>学生信息:</td>
                            <td>
                                <div style="border: solid 1px #ccc; min-height: 165px;max-height: 165px;width: 600px;">
                                    <table id="tablejl"
                                           style="width: 360px; min-height:50px;border-spacing:0;white-space:nowrap;">
                                        <tr class="tr">
                                            <td class="tr_td"><input
                                                    type="checkbox"
                                                    name="check"
                                                    class="check">
                                            </td>
                                            <td align="center">学员</td>
                                            <td align="center">学员编码</td>
                                        </tr>
                                        <tr>
                                            <td class="tr_td"><input class='check2' type="checkbox" name="check2">
                                                <input type="hidden" name="zxsNameid">
                                            </td>
                                            <td name='notcheck' align='center'><input onclick='clickName($(this))'
                                                                                      class='zxsName'
                                                                                      style='width: 140px;'
                                                                                      type='text' name='zxsName'
                                                                                      value=''/>
                                            </td>
                                            <td align='center'><input class='zxsfnumber' style='width: 200px;'
                                                                      type='text' name='zxsfnumber' value=''/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td style="padding-top: 40px;">创建者:</td>
                            <td style="padding-top: 40px;">
                                <input type="text" name="name" disabled="disabled" style="color: gray;"
                                       value="${createName}"/>
                            </td>
                            <td style="padding-top: 40px;">创建时间:</td>
                            <td style="padding-top: 40px;" colspan="2">
                                <input type="text" name="cfaddress" disabled="disabled" value="" style="color: gray;"/>
                            </td>
                        </tr>

                    </table>
                    <div class="div_tj" style="height: 100px;margin-top: 30px">
                        <div>
                            <input type="submit" onclick="submitCheck()" class="input_submit bc" value="">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>
        <!-- 修改页面-->
        <c:if test="${flag eq 2 }">
            <div class="div_form" style="margin: 0 20px;width: auto;">
                <form id="form" action="<%=path%>/DrivingSys/update_Sharecarsub" method="post" class="form">
                    <input type="hidden" name="state" value="1">
                    <table id="tablelist">
                        <tr>
                            <td rowspan="5" style="padding-right: 20px">
                                <img class="photo" width="180px" height="200px" src="">
                            </td>
                            <td>驾校:</td>
                            <td>
                                <input type="text" value="${department}" disabled="disabled" style="color: gray;"/>
                                <input type="hidden" name="cfficompanyid" value="${department}">
                                <input type="hidden" class="state" value="1">
                                <input type="hidden" name="fid" value="${sharecarsub.fid}">
                            </td>
                            <td>练车时间:</td>
                            <td>
                                <c:if test="${sharecarsub.cfsubject == 2}">
                                    <input name="cfdycs" value="${sharecarsub.kmelcsj}" style="color: gray;"
                                           onclick="clicklcsj($(this))"/>
                                    <input type="hidden" name="cflcsjid" value="${sharecarsub.kmelcsjid}"
                                           style="color: gray;"/>
                                </c:if>
                                <c:if test="${sharecarsub.cfsubject == 3}">
                                    <input name="cfdycs" value="${sharecarsub.kmslcsj}" style="color: gray;"
                                           onclick="clicklcsj($(this))"/>
                                    <input type="hidden" name="cflcsjid" value="${sharecarsub.kmslcsjid}"
                                           style="color: gray;"/>
                                </c:if>

                            </td>
                            <td>科目:</td>
                            <td colspan="3">
                                <select style="width: 150px;height: 32px" class="cfbilltype" name="cfsubject">
                                    <c:if test="${sharecarsub.cfsubject == 2}">
                                        <option selected="selected" value="2" style="font-size: 16px">科目二</option>
                                    </c:if>
                                    <c:if test="${sharecarsub.cfsubject == 3}">
                                        <option value="3" style="font-size: 16px">科目三</option>
                                    </c:if>
                                </select>
                            </td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>单据编码:</td>
                            <td><input type="text" name="fnumber" style="color: gray;"
                                       value="${sharecarsub.fnumber}"/></td>
                            <td>学员编码:</td>
                            <td><input type="text" class="cfstudentno" name="cfstudentno"
                                       value="${sharecarsub.xsfnumber}" onclick='clickName($(this))'/>
                            </td>
                            <td>学员名称:</td>
                            <td>
                                <input value="${sharecarsub.cfstudentname}" type="text" class="cfstudentname"
                                       disabled="disabled" style="color: gray;"/>
                                <input value="${sharecarsub.cfstudentid}" type="hidden" name="cfstudentid"
                                       class="cfstudentid" value="">
                                <input value="${sharecarsub.cfstudentname}" type="hidden" name="cfstudentname"
                                       class="cfstudentname">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <c:if test="${sharecarsub.cfvip ne 1}">
                                    <input type="checkbox" id="cfvip" style="color: gray;float: left;"/>
                                    <input type="hidden" name="cfvip" class="cfvip">
                                    <div style="height: 30px;display:table-row-group;float: left;margin: 5px 10px">VIP
                                    </div>
                                </c:if>

                                <c:if test="${sharecarsub.cfvip eq 1}">
                                    <input checked="checked" type="checkbox" id="cfvip"
                                           style="color: gray;float: left;"/>
                                    <input type="hidden" name="cfvip" class="cfvip">
                                    <div style="height: 30px;display:table-row-group;float: left;margin: 5px 10px">VIP
                                    </div>
                                </c:if>
                            </td>
                            <td>班级:</td>
                            <td class="clazz">
                                <input type="text" class="cfclazzName" value="${sharecarsub.classname}"/>
                                <input type="hidden" name="cfclazzid" class="cfclazzid" value="">
                            </td>
                            <td>预约结果:</td>
                            <td>
                                <select style="width: 150px;height: 32px" name="cfsubresult">
                                    <option value="1" selected="selected" style="font-size: 16px">预约成功</option>
                                    <option value="2" style="font-size: 16px">预约失败</option>
                                </select>
                            </td>
                        </tr>
                        <tr>


                            <td>电话:</td>
                            <td>
                                <input type="text" class="cfphone" disabled="cfphone" style="color: gray;"
                                       value="${sharecarsub.cfphone}"/>
                                <input type="hidden" name="cfphone" class="cfphone">
                            </td>
                            <td>申请准驾车型:</td>
                            <td>
                                <select style="width: 150px;height: 32px" disabled="disabled">
                                    <option value="${sharecarsub.cfsqzjcxdh}" style="font-size: 16px"
                                            class="cfsqzjcxdh">${sharecarsub.cfsqzjcxdh}</option>
                                </select>
                                <input type="hidden" name="cfsqzjcxdh" class="cfsqzjcxdh"
                                       value="${sharecarsub.cfsqzjcxdh}">
                            </td>
                            <td>下一次预约日期:</td>
                            <td colspan="3">
                                <input type="text" id="cfnexttime" name="cfnexttime" value="${sharecarsub.cfnexttime}"
                                       onclick="WdatePicker({el:'cfnexttime',dateFmt:'yyyy-MM-dd'})">
                            </td>
                            <td><img onclick="WdatePicker({el:'cfnexttime',dateFmt:'yyyy-MM-dd'})"
                                     src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px"></td>
                        </tr>
                        <tr>
                            <td>教练名称:</td>
                            <td>
                                <input type="text" name="cfcoachname" class="cfcoachname"
                                       style="color: gray;" value="${sharecarsub.cfcoachname}"/>
                                <input type="hidden" name="cfcoachid" class="cfcoachid"
                                       value="${sharecarsub.cfcoachid}">
                            </td>
                            <td>预约教练编码:</td>
                            <td><input type="text" class="yyjlfnumber" onclick='clickJlname($(this))'
                                       style="color: gray;" value="${sharecarsub.yyjlfnumber}"/>
                                <input type="hidden" name="yyjlfnumber" class="yyjlfnumber"
                                       value="${sharecarsub.yyjlfnumber}"/>
                            </td>
                            <td>原教练:</td>
                            <td>
                                <input type="text" class="yjlname" disabled="disabled" value="${sharecarsub.yjlname}"
                                       style="color: gray;"/>
                                <input type="hidden" name="cfoldcoachid" class="yjlname"
                                       value="${sharecarsub.cfoldcoachid}">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>科目二考试时间:</td>
                            <td><input type="text" name="cfkmekssj" class="cfkmekssj" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfkmekssj}"/>
                                <input type="hidden" name="cfkmekssj" class="cfkmekssj"
                                       value="${sharecarsub.cfkmekssj}">
                            </td>
                            <td>科目三不及格时间:</td>
                            <td>
                                <input type="text" name="cfkmsbjksj" class="cfkmsbjksj" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfkmsbjksj}"/>
                                <input type="hidden" name="cfkmsbjksj" class="cfkmsbjksj"
                                       value="${sharecarsub.cfkmsbjksj}">
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>应收金额:</td>
                            <td><input type="text" class="cfamount" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfamount}"/>
                                <input type="hidden" name="cfamount" class="cfamount" value="${sharecarsub.cfamount}">
                            </td>
                            <td>已收:</td>
                            <td><input type="text" class="cfreceived" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfreceived}"/>
                                <input type="hidden" name="cfreceived" class="cfreceived"
                                       value="${sharecarsub.cfreceived}">
                            </td>
                            <td>优惠:</td>
                            <td>
                                <input type="text" class="cffavorable" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cffavorable}"/>
                                <input type="hidden" name="cffavorable" class="cffavorable"
                                       value="${sharecarsub.cffavorable}">
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="5"></td>
                            <td>欠费:</td>
                            <td>
                                <input type="text" class="cfarrearage" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfarrearage}"/>
                                <input type="hidden" name="cfarrearage" class="cfarrearage"
                                       value="${sharecarsub.cfarrearage}">
                            </td>
                            <td>车型:</td>

                            <td>
                                <input type="hidden" class="cfcarbyte">
                                <select disabled="disabled" style="width: 150px;height: 32px">
                                    <c:if test="${sharecarsub.cfsqzjcxdh == 'A1' || sharecarsub.cfsqzjcxdh == 'A3' || sharecarsub.cfsqzjcxdh == 'B1' || sharecarsub.cfsqzjcxdh == 'B2'}">
                                        <option value="2" class="cfcarbyte" style="font-size: 16px">小车</option>
                                    </c:if>
                                    <c:if test="${sharecarsub.cfsqzjcxdh != 'A1' && sharecarsub.cfsqzjcxdh != 'A3' && sharecarsub.cfsqzjcxdh != 'B1' && sharecarsub.cfsqzjcxdh != 'B2'}">
                                        <option value="3" class="cfcarbyte" style="font-size: 16px">小车</option>
                                    </c:if>
                                </select>
                            <td>手机:</td>
                            <td>
                                <input type="text" class="cfmobile" disabled="disabled"
                                       style="color: gray;" value="${sharecarsub.cfmobile}"/>
                                <input type="hidden" name="cfmobile" class="cfmobile" value="${sharecarsub.cfmobile}">
                            </td>


                            </td>
                        </tr>
                        <tr>
                            <td>身份证号码:</td>
                            <td>
                                <input type="text" class="cfidcardno" name="cfidcardno" style="color: gray;"
                                       value="${sharecarsub.cfidcardno}"/>
                            </td>
                            <td>交补考费次数:</td>
                            <td>
                                <input value="${sharecarsub.cfjbkcs}" type="text" name="cfjbkcs" class="cfjbkcs"
                                       style="color: gray;"/>
                            </td>
                            <td>交补考费总额:</td>
                            <td>
                                <input value="${sharecarsub.cfjbkfje}" type="text" name="cfjbkfje" class="cfjbkfje"
                                       style="color: gray;"/>
                            </td>
                        </tr>
                        <tr>
                            <td>考试次数:</td>
                            <td>
                                <input value="${sharecarsub.cfkscs}" type="text" name="cfkscs" class="cfkscs"
                                       style="color: gray;"/>
                            </td>
                        </tr>
                        <tr>
                            <td>备注:</td>
                            <td colspan="2">
                                <textarea name="cfremark" rows="5" cols="78">${sharecarsub.cfremark}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div style="width: 200px; margin-left: 400px">
                                    <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px"
                                          class="addTable">添加</span>
                                    <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                    <span class="deleteTable" style="color: #a9bbe0;font-size: 14px"
                                          class="deleteTable">删除</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>学生信息:</td>
                            <td>
                                <div style="border: solid 1px #ccc; min-height: 165px;max-height: 165px;width: 600px;">
                                    <table id="tablejl"
                                           style="width: 360px; min-height:50px;border-spacing:0;white-space:nowrap;">
                                        <tr class="tr">
                                            <td class="tr_td"><input
                                                    type="checkbox"
                                                    name="check"
                                                    class="check">
                                            </td>
                                            <td align="center">学员</td>
                                            <td align="center">学员编码</td>
                                        </tr>
                                        <c:forEach items="${sharecarsubentryList}" var="sharecarsubentryList"
                                                   varStatus="fustatus">
                                            <tr>
                                                <td class="tr_td"><input class='check2' type="checkbox"
                                                                         name="check2"
                                                                         value="${sharecarsubentryList.fid}">
                                                    <input type="hidden" name="zxsNameid"
                                                           value='${sharecarsubentryList.cfstudentid}'></td>
                                                <td name='notcheck' align='center'><input onclick='clickName($(this))'
                                                                                          class='zxsName'
                                                                                          style='width: 140px;'
                                                                                          type='text' name='zxsName'
                                                                                          value='${sharecarsubentryList.cfstudentName}'/>
                                                </td>
                                                <td align='center'><input class='zxsfnumber' style='width: 200px;'
                                                                          type='text' name='zxsfnumber'
                                                                          value='${sharecarsubentryList.cfstudentno}'/>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td style="padding-top: 40px;">创建者:</td>
                            <td style="padding-top: 40px;">
                                <input type="text" name="name" disabled="disabled" style="color: gray;"
                                       value="${createName}"/>
                            </td>
                            <td style="padding-top: 40px;">创建时间:</td>
                            <td style="padding-top: 40px;" colspan="2">
                                <input type="text" name="cfaddress" disabled="disabled" value="" style="color: gray;"/>
                            </td>
                        </tr>

                    </table>
                    <div class="div_tj" style="height: 100px;margin-top: 30px">
                        <div>
                            <input type="submit" onclick="submitCheck()" class="input_submit bc" value="">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>


    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">

    $('.addTable').click(function () {
        var tr_len = $("#tablejl tr").length;
        if (tr_len > 3) {
            alert("最多只能添加三名同车！")
            return
        }
        var htmlperson = "<tr>" +
            "<td class='tr_td'><input class='check2' type='checkbox' name='check2' ><input type='hidden' name='zxsNameid' ></td>" +
            " <td name='notcheck' align='center'><input onclick='clickName($(this))' class='zxsName' style='width: 140px;'type='text' name='zxsName' value=''/> </td> " +
            "<td align='center'><input class='zxsfnumber' style='width: 200px;'type='text' name='zxsfnumber' value=''/> </td> " +
            "</tr>";
        $("#tablejl").append(htmlperson)
    })


    //弹出练车时间的信息框
    function clicklcsj(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data3').css('visibility', 'visible')
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e;
    }

    //选中的科目类型
    var cfbilltype = "";


    //弹出模式框学生信息
    function clickName(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        $('.data-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        cfbilltype = $('.cfbilltype').val()
        myname = $('.name1').val();
        cflxdh = $('.cflxdh').val();
        index = 1
        $('#studebntList').html("<div class='loading'></div>");
        $.ajax({
            url: '<%=path2%>/DrivingSys/getPageEnrol',
            type: "post",
            data: {
                'pindex': '0',
                'name': myname,
                'cfsjhm': cflxdh,
                'beginTime': beginTime.val(),
                'endTime': endTime.val(),
                'state': cfbilltype
            },
            dataType: "json",
            success: function (res) {
                $('#studebntList').html(myTemplate(res));
                $('#totalPage').val(res.pb);
            },
            error: function () {
                alert('Error');
            }
        });
        _this = e.parent().parent();
    }

    //弹出模式框教练信息
    function clickJlname(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data1').css('visibility', 'visible')
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e.parent().parent();
    }

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
        $('.modal-data1').css('visibility', 'hidden')
        $('.modal-data2').css('visibility', 'hidden')
        $('.modal-data3').css('visibility', 'hidden')
        $('.data-checkbox:checkbox').removeAttr('checked');
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.data2-checkbox:checkbox').removeAttr('checked');
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').hide();
    })

    //提交复选框
    function submitCheck() {

        if ($('#cfvip').attr('checked')) {
            $('.cfvip').val(1)
        } else {
            $('.cfvip').val(0)
        }
        if ($('#cfjnbjj').attr('checked')) {
            $('.cfjnbjj').val(1)
        } else {
            $('.cfjnbjj').val(0)
        }
        if ($('#cfdajj').attr('checked')) {
            $('.cfdajj').val(1)
        } else {
            $('.cfdajj').val(0)
        }

    }

    //设置全选功选
    $('.check').click(function () {
        if ($(this).attr("checked")) {
            $(".check2:checkbox").prop("checked", true)
        } else {
            $('.check2:checkbox').removeAttr('checked')
        }
    })
    //由于和input:checkbox冲突，在选择一次
    $("#tablejl tr td .check2:checkbox").live('click', function () {
        if ($(this).is('.check2:checked')) {
            $(this).removeAttr("checked");
        } else {
            $(this).attr("checked", ".check2:checked")
        }
    })
    //单击选中
    $("#tablejl tr td").live('click', function () {
        if ($(this).parent().find(".check2:checkbox").is(':checked')) {
            $(this).parent().find(".check2:checkbox").removeAttr("checked");
        } else {
            $(this).parent().find(".check2:checkbox").attr("checked", ":checked")
        }
    })

    //选中的删除
    $(".deleteTable").click(function () {
        var tr_len = $("#tablejl tr").length;
        if (tr_len == 2) {
            alert("最后一行不能删除！")
        } else {
            var s = '';
            $('input:checkbox[name=check2]').each(function (i) {

                if ($(this).is('.check2:checked')) {

                    $(this).parent().parent().remove();
                    s = '1';
                }
            })

            //判断是否选中
            if (s == null || s == '') {
                alert("请选择一条数据删除");
                return false;
            }
        }
    })
    //把选中的学生信息名称填充到输入框中
    $('.subtn').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=student]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        $.ajax({
            url: '<%=path%>/DrivingSys/selStudentsByFid',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {
                res = res.studentsNameList[0];
                if ($('#tablelist .cfstudentno').val() != "") {

                    _this.children().children('input[name=zxsName]').val(res.fnameL2)
                    _this.children().children('input[name=zxsNameid]').val(res.fid)
                    _this.children().children('input[name=zxsfnumber]').val(res.fnumber)
                    $('#modal-overlay').css('visibility', 'hidden')
                    $('.modal-data').css('visibility', 'hidden')
                    return
                }

                $('#tablelist .cfstudentno').val(res.fnumber);
                $('#tablelist .cfstudentname').val(res.fnameL2);
                $('#tablelist .cfstudentid').val(res.fid);
                if (res.cfvip == 1) {
                    $('#tablelist .cfvip').attr("checked", true);
                }
                $('#tablelist .cfclazzName').val(res.cfclazzName);
                $('#tablelist .cfclazzid').val(res.cfclazzid);
                $('#tablelist .cfsqzjcxdh').val(res.cfslzjcxdh);
                $('#tablelist .cfsqzjcxdh').text(/**/res.cfslzjcxdh);
                $('#tablelist .cfamount').val(res.cfamount);
                $('#tablelist .cfreceived').val(res.cfreceived);
                $('#tablelist .cffavorable').val(res.cffavorable);
                $('#tablelist .cfarrearage').val(res.cfarrearage);

                if (res.cfslzjcxdh == "A2" || res.cfslzjcxdh == "A3" || res.cfslzjcxdh == "B1" || res.cfslzjcxdh == "B2") {
                    $('#tablelist .cfcarbyteName').val("大车")
                    $('#tablelist .cfcarbyte').val("2")

                } else {
                    $('#tablelist .cfcarbyteName').val("小车")
                    $('#tablelist .cfcarbyte').val("1")
                }
                $('#tablelist .cfmobile').val(res.cfmobile);
                $('#tablelist .cfidcardno').val(res.cfidcardno);
                $('#tablelist .cfjbkcs').val(res.cfjbkcs);
                $('#tablelist .cfjbkfje').val(res.cfjbkfje);

                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });

    //把选中的教练信息名称填充到输入框中
    $('#subtn1').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=personfid]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        $.ajax({
            url: '<%=path%>/DrivingSys/selectPersonByFidAsPage',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {

                _this.children().children('input[class=cfcoachname]').val(res[0].jlname);
                _this.children().children('input[class=cfcoachid]').val(res[0].fid);
                _this.children().children('input[class=yyjlfnumber]').val(res[0].jlbumber);

                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data1').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });


    $('.input_back').click(function () {
        window.history.go(-1);
    })


</script>
</html>